import QtQuick
import QtQuick.Controls
import QtQuick.Layouts

Page {
    id: root
    title: "基本颜色"
    
    SystemPalette {
        id: systemPalette
        colorGroup: SystemPalette.Active
    }
    
    ScrollView {
        id: scrollView
        anchors.fill: parent
        contentWidth: availableWidth
        
        ColumnLayout {
            anchors.horizontalCenter: parent.horizontalCenter
            width: Math.min(parent.width - 40, 400)
            spacing: 20
            
            Item { height: 10 }
            
            Label {
                text: "系统颜色展示"
                font.pixelSize: 18
                font.bold: true
                Layout.fillWidth: true
                horizontalAlignment: Text.AlignHCenter
            }
            
            // 窗口颜色和窗口文本颜色
            Rectangle {
                Layout.fillWidth: true
                height: 100
                color: systemPalette.window
                
                Text {
                    anchors.centerIn: parent
                    text: "窗口颜色 (window): " + systemPalette.window + "\n" +
                          "窗口文本颜色 (windowText): " + systemPalette.windowText
                    color: systemPalette.windowText
                    horizontalAlignment: Text.AlignHCenter
                }
            }
            
            // 基础背景颜色和文本颜色
            Rectangle {
                Layout.fillWidth: true
                height: 100
                color: systemPalette.base
                
                Text {
                    anchors.centerIn: parent
                    text: "基础背景颜色 (base): " + systemPalette.base + "\n" +
                          "文本颜色 (text): " + systemPalette.text
                    color: systemPalette.text
                    horizontalAlignment: Text.AlignHCenter
                }
            }
            
            // 交替行背景颜色
            Rectangle {
                Layout.fillWidth: true
                height: 100
                color: systemPalette.alternateBase
                
                Text {
                    anchors.centerIn: parent
                    text: "交替行背景颜色 (alternateBase): " + systemPalette.alternateBase + "\n" +
                          "文本颜色 (text): " + systemPalette.text
                    color: systemPalette.text
                    horizontalAlignment: Text.AlignHCenter
                }
            }
            
            Item { height: 20 }
        }
    }
} 
